<%--
  Created by IntelliJ IDEA.
  User: 君未洋
  Date: 2021/5/3
  Time: 22:01
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Login</title>
  <script>
    window.onload = function(){
      document.getElementById("code").onclick = function(){
        this.src = "/ResponseCodeServlet?time="+new Date().getTime();
      }
    }

  </script>
  <style>
    div{
      color:red;
    }
  </style>
</head>
<body>
<form action="/loginServlet" METHOD="post">
  <table>
    <tr>
      <td>用户名</td>
      <td><input type="text" name = 'username' ></td>
    </tr>
    <tr>
      <td>密码</td>
      <td><input type="text" name = 'password' ></td>
    </tr>
    <tr>
      <td>验证码</td>
      <td><input type="text" name = 'checkCode' ></td>
    </tr>
    <tr>
      <td COLSPAN="2"><IMG id='code' SRC="/ResponseCodeServlet"></td>
    </tr>
    <tr>
      <td colspan="2"><input type="submit" value="登录"></td>
    </tr>
  </table>
</form>

<div><%=request.getAttribute("cc_error")==null?"":request.getAttribute("cc_error")%></div>
<div><%=request.getAttribute("login_error")==null?"":request.getAttribute("login_error")%></div>
</body>
</html>
